/* Created July 23, 2006.
 * Copyright (c) 2006, George Wright (geo@loyola.edu)
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions are met:
 *
 *     * Redistributions of source code must retain the above copyright notice, 
 *       this list of conditions and the following disclaimer.
 * 
 *     * Redistributions in binary form must reproduce the above copyright 
 *       notice, this list of conditions and the following disclaimer in the 
 *       documentation and/or other materials provided with the distribution.
 * 
 *     * Neither the name of George Wright nor the name of Loyola College
 *       may be used to endorse or promote products derived from this software 
 *       without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 * POSSIBILITY OF SUCH DAMAGE.
 * 
 * To learn more about open source licenses, please visit: 
 * http://opensource.org/index.php
 * 
 * changed by Vladimir Iglovikov
 */
package common;

import java.awt.Color;
import java.util.ResourceBundle;

/**
 * Various manifest constants for the arima package.
 * <p>
 * $Id: Constants.java,v 1.1 2008/07/02 12:48:57 Geo Exp $
 * </p>
 */
public interface Constants {
	/**
	 * Beginning of a zero-based collection.
	 */
	final int BEGINNING = 0;

	/**
	 * Standard border inset for Swing formatting.
	 */
	final int BORDER_INSET = 2;

	/**
	 * Preferred height of Swing buttons.
	 */
	final int BUTTON_HEIGHT = 25;

	/**
	 * Preferred width of Swing buttons.
	 */
	final int BUTTON_WIDTH = 163;

	/**
	 * Confidence level for f-test.
	 */
	final double CONFIDENCE_FACTOR = 1.96;

	/**
	 * Default color for display of the <code>Cra</code> forecast values.
	 */
	final Color CRA_FORECAST_COLOR = Color.CYAN;

	/**
	 * Size of large arrays used in Simmons' cycle regression analysis.
	 */
	final int CRA_LARGE_ARRAY_SIZE = 650;

	/**
	 * Size of medium arrays used in Simmons' cycle regression analysis.
	 */
	final int CRA_MEDIUM_ARRAY_SIZE = 325;

	/**
	 * Size of small arrays used in Simmons' cycle regression analysis.
	 */
	final int CRA_SMALL_ARRAY_SIZE = 29;

	/**
	 * Name of the Windows DLL with the CRA native code.
	 */
	final String CRAS_LIBRARY_NAME = "cras";

	/**
	 * Default height of Swing graphs.
	 */
	final int DEFAULT_GRAPH_HEIGHT = 300;

	/**
	 * Default width of Swing graphs.
	 */
	final int DEFAULT_GRAPH_WIDTH = 400;

	/**
	 * Count of values at the beginning of the originalSeries which are omitted
	 * from further analysis by default. The user may want to set these to begin
	 * analysis at the apparent beginning of a cycle.
	 */
	final int DEFAULT_RESERVED_FIRST = 0;

	/**
	 * Count of values at the end of the originalSeries which are omitted from
	 * further analysis by default. The use may want to hold back some values in
	 * order to cross-check with values produced by forecasting.
	 */
	final int DEFAULT_RESERVED_LAST = 0;

	/**
	 * Default sine control index.
	 */
	final int DEFAULT_SINE_CONTROL_INDEX = 1;

	/**
	 * Indicates no differences have been taken.
	 */
	final int DIFFERENCES_0 = 0;

	/**
	 * For first-order differencing.
	 */
	final int DIFFERENCES_1 = 1;

	/**
	 * Indicates two differences have been taken.
	 */
	final int DIFFERENCES_2 = 2;

	/**
	 * Indicates differences have been taken.
	 */
	final int DIFFERENCES_3 = 3;

	/**
	 * The amount for deciding that a significant difference exists between two
	 * numbers. Since much originalSeries processing involves differences
	 * between computer floating point numbers, we can't have exact equality.
	 */
	final double EPSILON = 0.0000000001;

	/**
	 * Five columns for grid layout.
	 */
	final int FIVE_COLUMNS = 5;

	/**
	 * Indicates we're using a full model for CRA construction.
	 */
	final int FULL = 3;

	/**
	 * Standard gap-size for Swing graphic displays.
	 */
	final int GAP = 2;

	/**
	 * Programmable look-and-feel setting for Windows format.
	 */
	final String LOOK_AND_FEEL = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";

	/**
	 * The maximum order of differencing allowable to achieve stationarity or
	 * seasonalization.
	 */
	final int MAX_DIFFERENCE_ORDER = 48;

	/**
	 * The number of lags that will be computed and displayed on a quad panel or
	 * histogram.
	 */
	final int MAX_LAG = 2000;

	/**
	 * The maximum lambda value in Simmons' cycle regression analysis.
	 */
	final int MAX_LAMBDA = 999999;

	/**
	 * Default maximum model parameter count.
	 */
	final int MAX_MODEL_PARAMETER = 3;

	/**
	 * The maximum acceptable period for seasonal adjustment.
	 */
	final int MAX_SEASONAL_PERIOD = 48;

	/**
	 * The maximum number of sine waves for cycle regression analysis.
	 */
	final int MAX_SINE_WAVES = 8;

	/**
	 * Default minimum model parameter count.
	 */
	final int MIN_MODEL_PARAMETER = 0;

	/**
	 * Default minimum count of observations necessary in order for analysis to
	 * proceed.
	 */
	final int MIN_OBSERVATION_COUNT = 10;

	/**
	 * The minimum acceptable period for seasonal adjustment.
	 */
	final int MIN_SEASONAL_PERIOD = 1;

	/**
	 * Indicates that no margins are used in a graph window.
	 */
	final int NO_MARGIN = 0;

	/**
	 * Indicates something isn't available.
	 */
	final String NOT_AVAILABLE = "<n/a>";

	/**
	 * The minimum increment by which the lowest value in the originalSeries
	 * exceeds zero when offset.
	 */
	final double OFFSET_INCREMENT = 0.5;

	/**
	 * Single-differencing constant.
	 */
	final int ONE = 1;

	/**
	 * One column for grid layout.
	 */
	final int ONE_COLUMN = 1;

	/**
	 * Degrees-to-radians conversion factor.
	 */
	final double RADIAN_FACTOR = 360.0 / 2.0 / Math.PI;

	/**
	 * Indicates we're using a reduced model for CRA construction.
	 */
	final int REDUCED = 0;

	/**
	 * Default color for reference graph.
	 */
	final Color REFERENCE_COLOR = Color.RED;

	/**
	 * Default color for regression graph.
	 */
	final Color REGRESSION_COLOR = Color.LIGHT_GRAY;

	/**
	 * Sine wave color choices.
	 */
	final Color[] SINE_COLOR = { Color.BLUE, Color.DARK_GRAY, Color.GRAY,
			Color.GREEN, Color.MAGENTA, Color.ORANGE, Color.PINK, Color.YELLOW };

	/**
	 * Manifest constant for raising an argument to the second power.
	 */
	final double SQUARED = 2.0;

	/**
	 * Internationalizes the program. Bundles currently available for U.S.
	 * English and Spanish.
	 */
	final ResourceBundle STRINGS = ResourceBundle.getBundle("Strings");

	/**
	 * Indicates Chile, used to test Spanish internationalization.
	 */
	final String TEST_COUNTRY = "CL";

	/**
	 * Indicates Spanish, used to test Spanish internationalization.
	 */
	final String TEST_LANGUAGE = "es";

	/**
	 * Preferred text field width.
	 */
	final int TEXT_FIELD_WIDTH = 4;

	/**
	 * Quad panel column-count.
	 */
	final int TWO_COLUMNS = 2;

	/**
	 * Twice pi to full machine accuracy.
	 */
	final double TWO_PI = Math.PI * 2.0;

	/**
	 * Quad panel row count.
	 */
	final int TWO_ROWS = 2;

	/**
	 * Title of warning dialog box.
	 */
	final String WARNING = "Warning";

	/**
	 * Default histogram padding.
	 */
	final int Y_PADDING = 20;

	/**
	 * String representation of zero.
	 */
	final String ZERO = "0";

	/**
	 * The default color for the horizontal axis.
	 */
	final Color ZERO_COLOR = Color.BLACK;

	/**
	 * Indicates a double zero value.
	 */
	final double ZERO_DOUBLE = 0.0;
}
